package com.atguigu.day16.collectiontest;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;

/**
 * @author fenge
 */
public class Test01 {
    public static void main(String[] args) {
        ArrayList<String> arrayList = new ArrayList<>();
        char[] ascii = new char[62];
        for (int index = 0; index < 10; index++)
            ascii[index] = (char) ('0' + index);
        for (int index = 0; index < 26; index++)
            ascii[index + 10] = (char) ('a' + index);
        for (int index = 0; index < 26; index++)
            ascii[index + 36] = (char) ('A' + index);
        char[] sub = new char[6];
        for (int i = 0; i < 10; i++) {
            for (int j = 0; j < 6; j++) {
                sub[j] = ascii[(int)(Math.random()*62)];
            }
            System.out.println(Arrays.toString(sub));
            arrayList.add(new String(sub));
        }
        Iterator iterator = arrayList.iterator();
        for (String s : arrayList) {
            System.out.println(iterator.next().toString());
        }
    }
}
